<template lang="pug">
  .homepart
    div.mbx
      span.ml24 档案管理
      div(@click="$router.push('/operative/archives')")
        span 档案列表
        img(src="@/assets/right.png")
    el-row(:gutter="20" :loading="loading")
      el-col(:span="12" v-for="(item, index) in list" :key="index")
        .quikBox(@click="goInfo(item.id)")
          .innerbox
            svg-icon(icon-class="file" style="font-size: 84px")
            h3 {{item.title}}
    <div class="quesheng" v-if="list.length<=0&&!loading">
      <img src="@/assets/quesheng.png" alt="">
      <span>暂无数据</span>
    </div>
</template>
<script>
import { mapGetters } from 'vuex'
import { getList } from '../archives/api'
export default {
  data () {
    return {
      list: [
      ],
      loading: false
    }
  },
  computed: {
    ...mapGetters(['curArea'])
  },
  created () {
    this.getList()
  },
  methods: {
    getList () {
      const { curArea } = this
      this.loading = true
      getList({ type: 0, areaId: curArea.areaId, pageSize: 7, pageNum: 0 }).then(res => {
        this.list = res.content || []
      }).finally(() => {
        this.loading = false
      })
    },

    goInfo (id) {
      this.$router.push({
        path: '/operative/archives/info',
        query: {
          dirId: id
        }
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.homepart{
  background-color: #fff;
  border-radius: 8px;
  padding: 24px;
  .mbx{
    padding: 0 !important;
  }
}
.quikBox{
  margin-bottom: 20px;
  height: 175px;
  background: #FAFAFA;
  border: 2px solid transparent;
  border-radius: 20px;
  text-align: center;
  position: relative;

  &:hover{
    border-color: #DA473A;
    cursor: pointer;
  }

  h3 {
    font-size: 15px;
    font-family: PingFang SC;
    font-weight: bold;
    color: #6E645A;
    line-height: 24px;
    margin: 0;
    margin-top: 15px;
  }

  .innerbox{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
  }
}
</style>
